#pragma once

#include "D3DWnd.h"
// CRenderWnd
#include "DXUT/Optional/DXUTcamera.h"
#include "RenderTech/RenderHeightMap.h"

class CRenderWnd : public CD3DWnd
{
	DECLARE_DYNAMIC(CRenderWnd)

public:
	CRenderWnd();
	virtual ~CRenderWnd();	

	virtual HRESULT OnCreateResource(ID3D11Device* pd3dDevice);
	virtual HRESULT OnSwapChainResize( ID3D11Device* pd3dDevice, IDXGISwapChain* pSwapChain, 
		const DXGI_SURFACE_DESC* pBackBufferSurfaceDesc);
	virtual	void	OnRender(ID3D11Device* pd3dDevice, ID3D11DeviceContext* pd3dImmediateContext, double fTime, float fElapsedTime);
	virtual void OnReleasingSwapChain();
	virtual void OnDestroyResouce();	
	virtual void OnFrameMove(double fTime, float fElapsedTime);

	inline CRenderHeightMap* GetRenderHMTech() {return m_pRenderHeightMapTech;}
	HRESULT	SetXYZFilePointer(CXYZFileIO* pXYZFile); 

	inline void SetXYZFileLoadStatus(bool bStatus) { m_bXYZLoaded = bStatus;}
	inline void SetXYZFileProcessStatus(bool bStatus) { m_bXYZProcessed = bStatus;}
	inline bool GetXYZFileLoadStatus() {return m_bXYZLoaded;}
	inline bool GetXYZFileProcessStatus() {return m_bXYZProcessed;}

protected:
//shared variables
   CDirectoryUtil*             m_pDirectoryUtil;
   CModelViewerCamera          m_modelViewCamera;   
//render tech
   CXYZFileIO*      m_pXYZFile;
   CRenderHeightMap* m_pRenderHeightMapTech;

//for threading
   bool m_bXYZLoaded;
   bool m_bXYZProcessed;

protected:
	void InitVariables();

protected:
	DECLARE_MESSAGE_MAP()
	virtual BOOL OnWndMsg(UINT message, WPARAM wParam, LPARAM lParam, LRESULT* pResult);
};


